home *** CD-ROM | disk | FTP | other *** search
/ MACD 5 / MACD 5.bin / workbench / tools / czesc_1 / afind / install / afind.install next >
Text File  |  1996-09-13  |  17KB  |  490 lines

  1. ; $VER: AFind.install 1.52 (02.09.96)
  2. ; Install script for AFind (Workbench 2.0 or higher)
  3. ;
  4. (COMPLETE 0)
  5. ;(USER 2)
  6. (SET #ApplicationName "AFind")
  7. (SET #ApplicationDir "sys:tools/")
  8. ;(SET #ApplicationDir "ram:")
  9. (SET #ArchiveDir "/")
  10. (SET #Language -1)
  11. (SET #Documents -1)
  12. (SET #ApplicationKeyfile (CAT #ApplicationName ".key"))
  13.  
  14. ;=============================================================================
  15. ; German strings
  16.  
  17. (IF (= @language "deutsch")
  18. (
  19. (SET default_lang 2)
  20.  
  21. (SET #bad-kick "Sie benötigen Workbench 2.0 oder größer")
  22. (SET #bad-installer
  23. (CAT "Achtung! Es ist eine alte Version des Programmes 'Installer' "
  24.      "auf Ihrem Amiga!\n\nDie Installation benötigt mindestens Installer 42.9.\n\n"
  25.      "Bitte überprüfen Sie Ihre Konfiguration!\n"
  26.      "Wenn Sie fortfahren, wird eine Vollinstallation vorgenommen, das heißt\n"
  27.      "es werden alle Kataloge,Anleitungen und die OS2.0+ Version installiert.\n"
  28.      "%s ist auch dann voll einsatzfähig!"
  29. ))
  30.  
  31. (SET #App-InstallMsg
  32. (CAT "\n\%s Installationsskript.\n"
  33.         "Diese Skript installiert %s auf Ihrem Amiga.\n\n"
  34.         "Lesen Sie das Anleitungs-File für weitere Informationen\n"
  35.         " über den Vertrieb von %s.\n\n"
  36.         "%s © 1995-96 Guido Mersmann\n"
  37.         "All Rechte reserviert."
  38. ))
  39.  
  40. (SET #App-Where
  41. (CAT "Wo möchten Sie %s installieren ?\n"
  42.         "(Ein Verzeichnis wird angelegt)"
  43. ))
  44.  
  45. (SET #App-Update
  46. (CAT "\nEin %s-Verzeichnis existiert im ausgewählen"
  47.         " Verzeichnis. Wenn Sie fortfahren,"
  48.         " bestätigen Sie, daß Sie die alte %s-Installation"
  49.         " mit der neuesten Version updaten wollen.\n"
  50.         "Verschiedene %s-Dateien (z.B Prefs) werden falls nötig überschrieben!"
  51. ))
  52.  
  53. (SET #App-Main "Welche Version von %s möchten Sie installieren?")
  54. (SET #App-Main-help
  55. (CAT "Die OS2.0+ Version läuft unter allen Systemen ab OS2.0."
  56.      " Die OS2.1+ Version hat den Nutzen, daß sie weniger Resourcen"
  57.      " benutzt, wenn sich %s im Hintergrund befindet. Dazu MUß"
  58.      " die Locale.library eingebunden sein. Für die OS3.0+ gilt das selbe"
  59.      " wie für die OS2.1 Verison. Es werden OS3.0+ Routinen benutzt, die"
  60.      " weiteren Speicher sparen."
  61. ))
  62.  
  63. (SET #App-Language "Welche Sprachen sollen installiert werden ?")
  64.  
  65. (SET #App-Language-help
  66. (CAT "\nDer Amiga kann in vielen verschiedenen Sprachen"
  67.          " arbeiten. Um Plattenkapazität zu sparen können Sie"
  68.          " nur die Sprachen anwählen, die sie benötigen"
  69.          " Haken Sie also einfach die Sprachen ab, die Sie"
  70.          " Ihrem System zugänglich machen wollen."
  71.           @askoptions-help
  72. ))
  73.  
  74. (SET #App-Docs "Welche Anleitungs- und Informationsdateien wollen Sie installieren ?")
  75.  
  76. (SET #startup-prompt    "Jetzt werden für %s folgende Eintragungen in die S:User-Startup gemacht:\n\n%s")
  77.  
  78.  
  79. (SET #App-Exit "\n%s installiert !!")
  80.  
  81.  
  82. ))
  83.  
  84. ;=============================================================================
  85. ; English strings
  86.  
  87. (IF (<> @language "deutsch")
  88. (
  89. (SET default_lang 4)
  90.  
  91. (SET #bad-kick "You must have at least Workbench 2.0+")
  92. (SET #bad-installer
  93. (CAT "You have an old version of the program 'Installer' "
  94.      "on your Amiga!\n\nThe installation procedure needs at least Installer 42.9.\n\n"
  95.      "Please check your configuration!\n\n"
  96.      "If you proceed the whole archive will be installed.\n"
  97.      "%s will work without any restrictions!"
  98. ))
  99.  
  100. (SET #App-InstallMsg
  101. (CAT "\n\%s installation script.\n"
  102.         "This script installs %s on your Amiga.\n\n"
  103.         "Read the DOK-file for more information\n"
  104.         " on the distribution of %s.\n\n"
  105.         "%s © 1995-96 Guido Mersmann\n"
  106.         "All rights reserved."
  107. ))
  108.  
  109. (SET #App-Where
  110. (CAT "Where would you like to install %s ?\n"
  111.         "(A drawer will be created)"
  112. ))
  113.  
  114. (SET #App-Update
  115. (CAT "\nA %s drawer does already exist in the selected "
  116.         " directory. By selecting \"Proceed\", you"
  117.         " indicate that you want to update the %s"
  118.         " installation with the most recent version.\n"
  119.         "Several %s specific files will be overwritten!"
  120. ))
  121.  
  122. (SET #App-Main "Which %s version should be installed ?")
  123. (SET #App-Main-help
  124. (CAT "The OS2.0+ version should only be used on Systems with OS2."
  125.      " The OS2.1+ and the OS3.0+ version need less Memory. Locale is required!"
  126.      " Special OS3.0+ functions are used to save more memory."
  127. ))
  128.  
  129. (SET #App-Language "Which languages should be installed ?")
  130. (SET #App-Language-help
  131. (CAT "\nThe Amiga can be operated in many different"
  132.           " languages."
  133.           "To reduce the amount of space consumed by the"
  134.           " language files, you can select to have only the"
  135.           " files of specific languages copied.\n\n"
  136.           "Simply check the boxes of the languages you wish"
  137.           " to have available on your system.\n\n"
  138.           @askoptions-help
  139. ))
  140.  
  141. (SET #App-Docs "Which Amiga-guide files should be installed ?")
  142.  
  143. (SET #startup-prompt    "Some lines need to be added to S:User-Startup for %s\n\n%s")
  144.  
  145. (SET #App-Exit "\n%s installed !!")
  146.  
  147.  
  148. ))
  149. ;----------------------------------------------------------------------------
  150. ;----------------------------------------------------------------------------
  151. ;    P_Requirements
  152. ;----------------------------------------------------------------------------
  153. ;----------------------------------------------------------------------------
  154. (PROCEDURE P_Requirements
  155. ; Workbench 37 or better required
  156. (IF (< (/ (getversion) 65536) 37)
  157. (
  158.   (abort #bad-kick)
  159. )
  160. )
  161. ; Installer 42.9 or better required
  162. (if (< @installer-version 2752521)
  163.   (
  164. (user 2)
  165.     (message (#bad-installer #ApplicationName))
  166.     (welcome)
  167.  
  168. ;---- Simple Copy all ask
  169. (SET #ApplicationDir
  170.         (TACKON
  171.                 (ASKDIR
  172.                         (PROMPT (#App-Where #ApplicationName))
  173.                         (HELP @askdir-help)
  174.                         (default #ApplicationDir)
  175.                 )
  176.                 #ApplicationName
  177.         )
  178. )
  179. (MAKEDIR #ApplicationDir (INFOS))
  180. (MAKEDIR (TACKON #ApplicationDir "Prefs"))
  181. (DELETE (TACKON #ApplicationDir "AddIndexGUI"))
  182. (DELETE (TACKON #ApplicationDir "AddIndexGUI.info"))
  183. (DELETE (TACKON #ApplicationDir "Catalogs/deutsch/AddIndexGUI.catalog"))
  184. (DELETE (TACKON #ApplicationDir "Catalogs/english/AddIndexGUI.catalog"))
  185. (DELETE (TACKON #ApplicationDir "AFind.prefs"))
  186. (DELETE (TACKON #ApplicationDir "AddIndex.prefs"))
  187.                    (COPYFILES
  188.     (SOURCE "/")
  189.     (DEST #ApplicationDir)
  190.     (HELP @copyfiles-help)
  191.     (OPTIONAL <force>)
  192.     (ALL)
  193.     (INFOS)
  194.                    )
  195. (STARTUP #ApplicationName
  196.      (SET #dummy (cat "Path add Path " #ApplicationDir))
  197.       (HELP @startup-help)
  198.       (PROMPT (#startup-prompt #ApplicationName #dummy))
  199.       (COMMAND #dummy)
  200. )
  201.     (exit (quiet))
  202.   )
  203. )
  204. ) ;PROCEDURE
  205. ;----------------------------------------------------------------------------
  206. ;----------------------------------------------------------------------------
  207. ;    Ask for Catalogs
  208. ;----------------------------------------------------------------------------
  209. ;----------------------------------------------------------------------------
  210. (PROCEDURE P_AskCatalogs #Language
  211.  
  212. (SET #Dummy     (ASKOPTIONS
  213.                 (PROMPT #App-Language)
  214.                 (HELP #App-Language-help)
  215.                 (CHOICES
  216.                         "English"
  217.                         "Deutsch")
  218.                 (DEFAULT #Language)
  219.         )
  220. )
  221. ) ;PROCEDURE
  222. ;----------------------------------------------------------------------------
  223. ;----------------------------------------------------------------------------
  224. ;    Copy Selected Catalogs
  225. ;----------------------------------------------------------------------------
  226. ;----------------------------------------------------------------------------
  227. (PROCEDURE P_CopyCatalogs #Language
  228. (SET n 0)
  229. (SET #DestinationRoot (TACKON #ApplicationDir "Catalogs"))
  230. (SET #SourceRoot (TACKON #ArchiveDir "Catalogs"))
  231. (MAKEDIR #DestinationRoot)
  232.  
  233. (while (< n 2)
  234.         (SET #Dummy (SELECT n "english" "deutsch"))
  235.         (
  236.                 (IF (IN #Language n)
  237.                 (
  238.     (MAKEDIR (TACKON #DestinationRoot #Dummy))
  239.                         (COPYFILES
  240.                                 (SOURCE (TACKON #SourceRoot #Dummy))
  241.                                 (DEST (TACKON #DestinationRoot #Dummy))
  242.                                 (HELP @copyfiles-help)
  243.                                 (ALL)
  244.                         )
  245.                 )
  246.                 )
  247.         )
  248. (SET n (+ n 1))
  249. )
  250. ) ;PROCEDURE
  251. ;----------------------------------------------------------------------------
  252. ;----------------------------------------------------------------------------
  253. ;    Ask for docs
  254. ;----------------------------------------------------------------------------
  255. ;----------------------------------------------------------------------------
  256. (PROCEDURE P_AskDocs #Documents
  257. (SET #Dummy             (ASKOPTIONS
  258.                         (PROMPT #App-Docs)
  259.                         (HELP @askoptions-help)
  260.                         (CHOICES
  261.                         "english"
  262.                         "deutsch"
  263.                         )
  264.                         (DEFAULT #Documents)
  265.                   )
  266. )
  267. ) ;PROCEDURE
  268. ;----------------------------------------------------------------------------
  269. ;----------------------------------------------------------------------------
  270. ;    Copy docs
  271. ;----------------------------------------------------------------------------
  272. ;----------------------------------------------------------------------------
  273. (PROCEDURE P_CopyDocs #Documents
  274. (SET n 0)
  275. (SET #DestinationRoot (TACKON #ApplicationDir "Docs"))
  276. (SET #SourceRoot (TACKON #ArchiveDir "Docs"))
  277. (MAKEDIR #DestinationRoot)
  278.  
  279. (while (< n 2)
  280.         (SET #Dummy (SELECT n
  281.         "english"
  282.         "deutsch"
  283.     )
  284.         )
  285.         (
  286.                 (IF (IN #Documents n)
  287.                 (
  288.     (MAKEDIR (TACKON #DestinationRoot #Dummy))
  289.                         (COPYFILES
  290.                                 (SOURCE (TACKON #SourceRoot #Dummy))
  291.                                 (DEST (TACKON #DestinationRoot #Dummy))
  292.                                 (HELP @copyfiles-help)
  293.                                 (INFOS)
  294.                                 (ALL)
  295.                         )
  296.                 )
  297.                 )
  298.         )
  299. (SET n (+ n 1))
  300. )
  301. ) ;PROCEDURE
  302. ;----------------------------------------------------------------------------
  303. ;----------------------------------------------------------------------------
  304. ;    Copy_Dir (Dir)
  305. ;----------------------------------------------------------------------------
  306. ;----------------------------------------------------------------------------
  307. (PROCEDURE P_CopyDir #Dummy
  308.  
  309. (SET #DestinationRoot (TACKON #ApplicationDir #Dummy))
  310. (SET #SourceRoot (TACKON #ArchiveDir #Dummy))
  311. (MAKEDIR #DestinationRoot)
  312.  
  313.                    (COPYFILES
  314.     (SOURCE #SourceRoot)
  315.     (DEST #DestinationRoot)
  316.     (HELP @copyfiles-help)
  317.     (OPTIONAL <force>)
  318.     (ALL)
  319.     (INFOS)
  320.                    )
  321. ) ;PROCEDURE
  322. ;----------------------------------------------------------------------------
  323. ;----------------------------------------------------------------------------
  324. ;    Copy_File (Name)
  325. ;----------------------------------------------------------------------------
  326. ;----------------------------------------------------------------------------
  327. (PROCEDURE P_CopyFile #Dummy
  328.  
  329. (if (<> (exists (TACKON #ArchiveDir #Dummy) (noreq)) 0) 
  330. (
  331.                    (COPYFILES
  332.     (SOURCE (TACKON #ArchiveDir #Dummy))
  333.     (DEST #ApplicationDir)
  334.     (HELP @copyfiles-help)
  335.     (OPTIONAL <force>)
  336.     (ALL)
  337.     (INFOS)
  338.                    )
  339. )
  340. ) ;If
  341. ) ;PROCEDURE
  342. ;----------------------------------------------------------------------------
  343. ;----------------------------------------------------------------------------
  344. ;    GetApplicationDir
  345. ;----------------------------------------------------------------------------
  346. ;----------------------------------------------------------------------------
  347. (PROCEDURE P_GetApplicationDir #Dummy
  348.  
  349. (SET #ApplicationDir
  350.         (TACKON
  351.                 (ASKDIR
  352.                         (PROMPT (#App-Where #ApplicationName))
  353.                         (HELP @askdir-help)
  354.                         (default #Dummy)
  355.                 )
  356.                 #ApplicationName
  357.         )
  358. )
  359. ) ;PROCEDURE
  360. ;----------------------------------------------------------------------------
  361. ;----------------------------------------------------------------------------
  362. ;    P_Update
  363. ;----------------------------------------------------------------------------
  364. ;----------------------------------------------------------------------------
  365. (PROCEDURE P_Update
  366. (if (= (exists #ApplicationDir) 2)
  367.         (message (#App-Update #ApplicationName #ApplicationName #ApplicationName))
  368. )
  369. ) ;PROCEDURE
  370. ;----------------------------------------------------------------------------
  371. ;----------------------------------------------------------------------------
  372. ;    P_AskBinary
  373. ;----------------------------------------------------------------------------
  374. ;----------------------------------------------------------------------------
  375. (PROCEDURE P_AskBinary
  376. (set #Dummy (/ (getversion) 65536))
  377.  
  378. (if (= #Dummy 37) (set #Binary 0))
  379. (if (= #Dummy 38) (set #Binary 1))
  380. (if (> #Dummy 38) (set #Binary 2))
  381.  
  382. (set #Binary (askchoice
  383.     (prompt (#App-Main #ApplicationName))
  384.     (help (#App-Main-help #ApplicationName))
  385.     (choices
  386.     "OS2.0+"
  387.                            "OS2.1+"
  388.                            "OS3.0+"
  389.                         )
  390.     (default #Binary)
  391.             )
  392. )
  393. ) ;PROCEDURE
  394. ;----------------------------------------------------------------------------
  395. ;----------------------------------------------------------------------------
  396. ;    P_CopyBinary
  397. ;----------------------------------------------------------------------------
  398. ;----------------------------------------------------------------------------
  399. (PROCEDURE P_CopyBinary #Dummy
  400.  
  401. (set #BinaryName (SELECT #Binary #Dummy (CAT "Bin/" #Dummy "_OS21") (CAT "Bin/" #Dummy "_OS30")))
  402. (copyfiles
  403.         (source (tackon #ArchiveDir #BinaryName) (infos))
  404.         (dest #ApplicationDir)
  405.         (newname #Dummy)
  406.         (help @copyfiles-help)
  407.         (optional <force>)
  408. )
  409. ) ;PROCEDURE
  410. ;----------------------------------------------------------------------------
  411. ;----------------------------------------------------------------------------
  412. ;    P_KeyFile
  413. ;----------------------------------------------------------------------------
  414. ;----------------------------------------------------------------------------
  415. (PROCEDURE P_KeyFile
  416.  
  417. (SET #Dummy (tackon (tackon #ArchiveDir "Keyfile") #ApplicationKeyfile))
  418.  
  419. (if (<> (exists #Dummy (noreq)) 0) ((P_CopyDir "KeyFile"))
  420. )
  421. ) ;PROCEDURE
  422. ;----------------------------------------------------------------------------
  423. ;----------------------------------------------------------------------------
  424. ;    P_CopyArchiveIcon
  425. ;----------------------------------------------------------------------------
  426. ;----------------------------------------------------------------------------
  427. (PROCEDURE P_CopyArchiveIcon
  428.                    (COPYFILES
  429.     (SOURCE (CAT (CAT (TACKON #ArchiveDir "/") #ApplicationName) ".info"))
  430.     (DEST (TACKON #ApplicationDir "/"))
  431.     (HELP @copyfiles-help)
  432.                    )
  433. ) ;PROCEDURE
  434. ;----------------------------------------------------------------------------
  435. ;----------------------------------------------------------------------------
  436. ;    MAIN
  437. ;----------------------------------------------------------------------------
  438. ;----------------------------------------------------------------------------
  439. (P_Requirements)
  440. (message (#App-installmsg #ApplicationName #ApplicationName #ApplicationName #ApplicationName))
  441. (welcome)
  442.  
  443.  (SET #ApplicationDir (P_GetApplicationDir #ApplicationDir))
  444.  
  445. (COMPLETE 1)
  446.  (P_Update)
  447.  (SET #Binary (P_AskBinary))
  448. (COMPLETE 2)
  449.  (SET #Language (P_AskCatalogs #Language))
  450. (COMPLETE 3)
  451.  (SET #Documents (P_AskDocs #Documents))
  452. (COMPLETE 4)
  453.  
  454. ;***** Delete old Data and Prefs
  455. (MAKEDIR #ApplicationDir)
  456. (MAKEDIR (TACKON #ApplicationDir "Prefs"))
  457. (DELETE (TACKON #ApplicationDir "AddIndexGUI"))
  458. (DELETE (TACKON #ApplicationDir "AddIndexGUI.info"))
  459. (DELETE (TACKON #ApplicationDir "Catalogs/deutsch/AddIndexGUI.catalog"))
  460. (DELETE (TACKON #ApplicationDir "Catalogs/english/AddIndexGUI.catalog"))
  461. (DELETE (TACKON #ApplicationDir "AFind.prefs"))
  462. (DELETE (TACKON #ApplicationDir "AddIndex.prefs"))
  463.  
  464. (COMPLETE 10)
  465.  (P_CopyBinary #ApplicationName)
  466. (COMPLETE 20)
  467.  (P_CopyBinary "AddIndex")
  468. (COMPLETE 30)
  469.  (P_CopyArchiveIcon)
  470.  (P_CopyFile "AminetFind.info")
  471.  (P_CopyFile "AddIndex.info")
  472.  (P_CopyFile "Docs.info")
  473. (COMPLETE 40)
  474.  (P_CopyCatalogs #Language)
  475. (COMPLETE 50)
  476.  (P_CopyDocs #Documents)
  477. (COMPLETE 60)
  478.  (P_Keyfile)
  479. (COMPLETE 70)
  480. (STARTUP #ApplicationName
  481.      (SET #dummy (cat "Path add Path " #ApplicationDir))
  482.       (HELP @startup-help)
  483.       (PROMPT (#startup-prompt #ApplicationName #dummy))
  484.       (COMMAND #dummy)
  485. )
  486.  
  487. (COMPLETE 100)
  488.  
  489. ;(exit #App-exit)
  490.